
import React from 'react'
import { useParams, //获取地址id
  useLocation,  //获取路由传过来的数据
  useNavigate  //跳转路由的方法
 } from 'react-router-dom'
function Detail() {
  const navigate = useNavigate()
  const location = useLocation()
  const params = useParams();
  console.log(params)
  return (
    <div>
      
      <div>
        <button onClick={()=>navigate(-1)}>返回上一级</button>
        详情
         地址拦id:{params.id}

      </div>
    </div>
  )
}

export default Detail